#include <iostream>
#include <iomanip>
using namespace std;
float average(int * p, int N)
{
    int sum = 0;
    for(int i = 0; i<N; i++)
    {
        sum = sum + *(p+i);
    }
    return (float)sum/N;
}
int findMaxMin(int * p,int N,int * pMax,int * pMin)
{
    *pMax = * p;
    *pMin = * p;
    for(int i = 0; i<N; i++ )
    {
        if(*pMax < *(p+i))
            *pMax = *(p+i);
        if(*pMin > *(p+i))
            *pMin = *(p+i);

    }
    return 0;
}
/*
 重载上面的函数，注意参数不同，用了引用
*/
int findMaxMin(int * p,int N,int & pMax,int & pMin)
{
    pMax = * p;
    pMin = * p;
    for(int i = 0; i<N; i++ )
    {
        if(pMax < *(p+i))
            pMax = *(p+i);
        if(pMin > *(p+i))
            pMin = *(p+i);

    }
    return 0;
}
int main()
{
    int N;
    cin>>N;
    int * p = new int[N];
    for(int i = 0; i<N; i++)
    {
        cin>>*(p+i);
        //cout<<*(p+i)<<endl;
    }
    cout<<"average = "<<fixed<<setprecision(2)<<average(p,N)<<endl;
    int max,min;
    findMaxMin(p,N,&max,&min);
    //findMaxMin(p,N,max,min); //也可以这样
    cout<<"max = "<<fixed<<setprecision(2)<<(float)max<<endl;
    cout<<"min = "<<fixed<<setprecision(2)<<(float)min<<endl;
    delete [] p;
}